package utils;

import java.util.ArrayList;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class TxtFromXML {

	public static void main(String[] args) {
		
		ParserXML parser = new ParserXML("model/spu96a01.ecore");
		Document doc = parser.getDocument("model/spu96a01.ecore");
		
		ArrayList<Element> l_eAnnotation = parser.getElements(doc, "eAnnotations");
		Element eAnnotation = l_eAnnotation.get(0);
		
		System.out.println("> Source: " + parser.getAttributeValue(eAnnotation, "source"));
		
		ArrayList<Element> l_details = parser.getElements(eAnnotation);
		
		for (Element detail : l_details) {
			System.out.println("(" + parser.getAttributeValue(detail, "key") + " , " + parser.getAttributeValue(detail, "value") + ")");
			
		}
	}
}
